<template>
    <div class="result-page">
      <div class="result-main flex-box">
        <div>
          <img src="../assets/img/submit-fail.png">
          <h3>送检单提交失败</h3>
          <p>请点击下方按钮返回重新提交哦</p>
          <button @click="reSubmit" class="re-commit" v-bind:disabled="!clickAble" :class="{active : clickAble}">返回<span v-if="!clickAble">（{{time}}s）</span></button>
        </div>
      </div>
    </div>
</template>

<script>
// @ is an alias to /src
export default {
  name: "result",
  data() {
    return {
      time: 5,
      msg: "",
      clickAble: false
    };
  },
  components: {},
  computed: {},
  methods: {
    reSubmit() {
      this.$router.push("/sjSubmit");
    }
  },
  mounted() {
    // console.log(this.$store.state.submitMsg);
    let timeOut = setInterval(() => {
      this.time--;
      if (this.time <= 0) {
        this.clickAble = true;
        clearInterval(timeOut);
      }
    }, 1000);
  }
};
</script>
